/**
 * 
 */
package com.icbc.common.fileupload;

import java.io.File;

import com.icbc.cte.base.TranFailException;
import com.icbc.ctp.core.IContext;
import com.icbc.ctp.core.annotations.Input;
import com.icbc.ctp.core.annotations.JavaStep;
import com.icbc.ctp.core.annotations.Output;
import com.icbc.ctp.core.impl.OperationStep;

/**
 * TODO 类的描述：。 
 * <pre>
 *
 * </pre>
 *
 * <pre>
 * modify by lenovo on 2016-8-4
 *    fix->1.
 *         2.
 * </pre> 
 */
@Input(name = "fileUrl", type = "java:java.lang.String", mustInput = true, isVariable = true, isArray = false, description = "文件全路径")
@Output(name = {"isSuccess","retCode"}, type = {"java:java.lang.String","java:java.lang.String"}, isArray = {false,false}, description = {"是否删除成功","删除标识"})
public class DelFile extends OperationStep {

	/* (non-Javadoc)
	 * @see com.icbc.ctp.core.impl.OperationStep#execute(com.icbc.ctp.core.IContext)
	 */
	@Override
	protected int execute(IContext context) throws TranFailException {
		// TODO Auto-generated method stub
		String filePath = (String) getInputValue(context, "fileUrl");
		 File file =new File(filePath);
		 context.setValueAt("isSuccess",file.delete()); 
		 context.setValueAt("retCode",0); 
		return 0;
	}

	

}